﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PersonProject;

namespace Person_Form_Socket
{
    public class DS_WCFClient : PersonProject.iDS
    {
        PersonService.Service1Client client = new PersonService.Service1Client();

        public override List<Person> Load()
        {            
            PersonService.LoadResponse response = client.Load(new PersonService.LoadRequest());
            List<Person> pList = response.LoadResult;            
            return pList;
        }

        public override void Update(Person p)
        {
            client.Update(new PersonService.UpdateRequest(p));
        }

        public override void Delete(int ID)
        {
            client.Delete(new PersonService.DeleteRequest(ID));
        }
    }
}
